{if $this->operate == 'Index'}
{template header}
<script type="text/javascript" src="{PUB}Scripts/Admin/Node.js"></script>
<script type="text/javascript">
var commonAddUrl 	= '{:U('node/add?isPost=1')}';
var commonEditUrl	= '{:U('node/edit')}';
var commonDelUrl	= '{:U('node/del')}';
</script> 
<div class="loading3" id="loading3">加载中...</div>
<div id="header-menu" attr="菜单管理">
  <div class="menu-btn" id="add"> <a href="javascript:;">添加</a>
    <div class="menu-btn-l"></div>
    <div class="menu-btn-r"></div>
  </div>
</div>
<div class="clear"></div>
<form name="myform" method="post" id="menu_form" action="{:U('menu/update')}">
<div id="main-body">
<table border="0" align="center" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td class="title-1 c-item" width="30">ID</td>
    <td class="title-1 c-item">名称</td>
    <td class="title-1 c-item" width="120">所属菜单</td>
    <td class="title-1 c-item" width="120">控制器</td>
    <td class="title-1 c-item" width="120">操作</td>
    <td class="title-1 c-item" width="70">排序</td>
    <td class="title-1 c-item" width="70">是否使用</td>
    <td class="title-2 c-item" width="150">操作</td>
  </tr>
  {loop $list $key $vo}
  <tr>
    <td class="td-0 c-item" height="20">{$vo['id']}</td>
    <td class="td-1">{$vo['name']}</td>
    <td class="td-1 c-item">{$vo['menu_name']}</td>
    <td class="td-1">{$vo['controller']}</td>
    <td class="td-1">{$vo['operate']}</td>
    <td class="td-1 c-item">{$vo['sort']}</td>
    <td class="td-1 c-item">{$vo['use_name']}</td>
    <td class="td-2 c-item"><a href="javascript:;" onclick="commonEdit({$vo['id']})">修改</a> <a href="javascript:;" onclick="commonDel({$vo['id']});">删除</a></td>
  </tr>
  {/loop}
</table>
</div>
<div class="bottom-bar">
  &nbsp;
</div>
</form>
<div class="clear"></div>
{template footer}
{elseif $this->operate == 'Add'}
<form name="myform" id="myform" method="post" action="{:U('node/add')}">
<table border="0" align="center" width="400" cellpadding="0" cellspacing="0">
  <tr>
    <td class="title-0 c-item" colspan="2">添加菜单</td>
  </tr>
  <tr>
    <td class="td-0-1" width="40%" height="20" align="right">操作名称：</td>
    <td class="td-1"><input type="text" name="data[name]" id="name" size="30" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">控制器(controller)：</td>
    <td class="td-1"><input type="text" name="data[controller]" id="controller" size="30" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">操作(operate)：</td>
    <td class="td-1"><input type="text" name="data[operate]" id="operate" size="30" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">排序：</td>
    <td class="td-1"><input type="text" name="data[sort]" id="sort" value="0" size="5" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">是否使用：</td>
    <td class="td-1">
    <select name="data[is_use]" id="is_use">
    <option value="1">是</option>
    <option value="0">否</option>
    </select>
    </td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">所属于导航：</td>
    <td class="td-1">
    <select name="data[menu_id]" id="menu_id">
    <option value="">=请选择=</option>
    {loop $list $key $vo}
    <option value="{$vo['id']}">{$vo['name']}</option>
    {/loop}
    </select>
    </td>
  </tr>
</table>
<div class="loading2" id="loading2"></div>
</form>
{elseif $this->operate == 'Edit'}
<form name="myform" id="myform" method="post" action="{:U('node/edit?id='.$vo['id'])}">
<table border="0" align="center" width="400" cellpadding="0" cellspacing="0">
  <tr>
    <td class="title-0 c-item" colspan="2">编辑菜单</td>
  </tr>
  <tr>
    <td class="td-0-1" width="40%" height="20" align="right">操作名称：</td>
    <td class="td-1"><input type="text" name="data[name]" id="name" value="{$vo['name']}" size="30" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">控制器(controller)：</td>
    <td class="td-1"><input type="text" name="data[controller]" id="controller" value="{$vo['controller']}" size="30" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">操作(operate)：</td>
    <td class="td-1"><input type="text" name="data[operate]" id="operate" value="{$vo['operate']}" size="30" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">排序：</td>
    <td class="td-1"><input type="text" name="data[sort]" id="sort" value="{$vo['sort']}" size="5" class="input-1" /></td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">是否使用：</td>
    <td class="td-1">
    <select name="data[is_use]" id="is_use">
    <option value="1"{if $vo['is_use'] == 1} selected="selected"{/if}>是</option>
    <option value="0"{if $vo['is_use'] == 0} selected="selected"{/if}>否</option>
    </select>
    </td>
  </tr>
  <tr>
    <td class="td-0-1" height="20" align="right">所属导航：</td>
    <td class="td-1">
    <select name="data[menu_id]" id="menu_id">
    <option value="">=请选择=</option>
    {loop $list $key $vv}
    <option value="{$vv['id']}"{if $vo['menu_id'] == $vv['id']} selected="selected"{/if}>{$vv['name']}</option>
    {/loop}
    </select>
    </td>
  </tr>
</table>
<div class="loading2" id="loading2"></div>
</form>
{/if}